const comment = function (Mock) {
    function getComemntByStoreId() {
        let comment = Mock.mock({
            storeScore: '@float(0, 5, 1, 1)',
            tasteScore: '@float(0, 5, 1, 1)',
            packScore: '@float(0, 5, 1, 1)',
            deliveryScore: '@float(0, 5, 1, 1,)',
            commentList: Mock.mock({
                'array|20': [{
                    id: '@id',
                    nickname: '@cword(2, 10)',
                    avatar: '@image("30x30", @color)',
                    score: '@integer(1, 5)',
                    commentTime: '@date("yyyy.MM.dd")',
                    content: '@cparagraph(2)',
                    replay: '@cparagraph(2)',
                }]
            }).array
        })
        return {
            comment,
            code: 200,
        }
    }

    function getCommentByUserId(){
        let commentList = Mock.mock({
            'array|10':[{
                id: '@id',
                storeName: '@cword(3, 8)',
                storeScore: '@float(1, 5, 1, 1)',
                riderScore: '@float(1, 5, 1, 1)',
                storeImage: '@image("50x50", @color)',
                commentTime: '@date'
            }]
        }).array

        return{
            commentList,
            code: 200,
        }
    }

    Mock.mock(/\/comment\/getCommentByStoreId.*?/, 'get', getComemntByStoreId)
    Mock.mock('/comment/getCommentByUserId', 'post', getCommentByUserId)

}

export default comment